package CHpackage;

public class Children
{

    private String name;
    private String sex;
    private int age;
    private String hobbies;

    private static int count = 0;

    public Children(String name, String sex, int age, String hobbies) {
        this.name = name;
        this.sex =sex;
        this.age = age;
        this.hobbies = hobbies;
        count++;
    }

    private static int getCount(){
        return count;
    }

    public void printChildrenInfo(int position){
        System.out.println("**第"+position+"位**");
        System.out.println(name+"小朋友："+sex+"，"+age+"岁");
        System.out.println(name+"爱好:"+hobbies);
    }

    public static void main(String[] args) {
        Children children1 = new Children("Lucy","女",6,"唱歌、朗诵");
        Children children2 = new Children("威廉","男",5,"钢琴、表演");
        Children children3 = new Children("安娜","女",4,"舞蹈、书法");
        children1.printChildrenInfo(1);
        children2.printChildrenInfo(2);
        children3.printChildrenInfo(3);


    }

}
